package com.jc.service.api.product;

import com.alibaba.fastjson.JSONObject;
import com.jc.ds.base.service.BaseServiceException;
import com.jc.ds.model.*;
import com.jc.framework.enums.ImageStatus;
import com.jc.framework.enums.ProductPrice;
import com.jc.framework.enums.Push;
import com.jc.framework.util.SpringUtils;
import com.jc.service.api.BaseDual;
import com.jc.service.attribute.AttributeService;
import com.jc.service.attributevalue.AttributeValueService;
import com.jc.service.productattribute.ProductAttributeService;
import com.jc.service.supplier_product.SupplierProductService;
import com.jc.service.suppliergoods.SupplierGoodsService;
import com.jc.service.suppliergoodspicturelist.SupplierGoodsPictureListService;
import com.jc.service.supplierproductprice.SupplierProductPriceService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

@SuppressWarnings("all")
public class add extends BaseDual<Product> {
//	 SupplierGoodsService supplierGoodsService = SpringUtils.getBean(SupplierGoodsService.class);
	 SupplierProductService supplierProductService = SpringUtils.getBean(SupplierProductService.class);
//	 AttributeService attributeService = SpringUtils.getBean(AttributeService.class);
//	 AttributeValueService attributeValueService = SpringUtils.getBean(AttributeValueService.class);
//	 ProductAttributeService productAttributeService = SpringUtils.getBean(ProductAttributeService.class);
//	 SupplierProductPriceService supplierProductPriceService = SpringUtils.getBean(SupplierProductPriceService.class);
//	 SupplierGoodsPictureListService supplierGoodsPictureListService = SpringUtils.getBean(SupplierGoodsPictureListService.class);


	@Override
	public ResponseEntity<?> dual(JSONObject data){
			//转换成对应的实体类 ,
			Product product = getData(data);
			if(product == null) {
				throw new BaseServiceException("缺少业务实体参数");
			}
		supplierProductService.pullPro(product);
		return null;
	}



}
